import Axios from "axios";
import { useState } from "react";
const App = () => {
  const mediareports = {
    page_number: "1",
    page_size: "10",
  };
  const [list, setLi] = useState([]);
  // const cfg = mediareports;
  // this.getApi('/api',cfg,{}).then((res)=>{
  //     console.log(res.data)
  // })
  // this.getApi('/wp-json/wp/v2/posts',{},{}).then((res)=>{
  //     console.log(res.data)
  // })

  // async getApi(url,cfg,headers){
  //     let data = await Axios.get(url,{params:cfg},
  //                                {
  //         headers: headers
  //     })
  //     return data;
  // }
  Axios.get("/api", { params: mediareports }).then((result) => {
    setLi(...list, result);
  });
  return {};
};

export default App;
